import Mock from 'mockjs'
const technologMenudata = {
  'code': 0,
  'data': [
    {
      'domainId': '1',
      'domainName': '技术',
      'domainDesc': '这是技术'
    },
    {
      'domainId': '2',
      'domainName': '业务',
      'domainDesc': '这是业务'
    },
    {
      'domainId': '3',
      'domainName': '生产',
      'domainDesc': '这是业务'
    },
    {
      'domainId': '4',
      'domainName': '销售',
      'domainDesc': '这是业务'
    }
  ]
}
const domainList = []
const userCount = 10
for (let i = 0; i < userCount; i++) {
  domainList.push(Mock.mock({
    domainId: '@increment',
    domainName: '@cname(2, 3)',
    'domainDesc': /[a-z]{5,10}/,
    'state|1': ['0', '1'],
    'icon': /[QY][0-9]{5,10}/,
    'sort|1-100': 100,
    'modules|1': ['0', '1'],
    createBy: '@ctitle(4,10)',
    createTime: '@datetime',
    updateBy: '@cname(2, 3)',
    updateTime: '@datetime'
  }))
}
export default [
  {
    url: '/domain/list',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '请求成功',
        data: {
          technologMenudata
        }
      }
    }
  },
  {
    url: '/module/getUserModuleList',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '请求成功',
        data: {
          domainList,
          'pageTotal|100-1000': 1000
        }
      }
    }
  }
]
